package com.changgou.order.controller;

import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import com.changgou.order.pojo.OrderComment;
import com.changgou.order.service.OrderCommentService;
import com.netflix.discovery.converters.Auto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/orderComment")
public class OrderCommentController {
    @Autowired
    private OrderCommentService orderCommentService;


    @GetMapping
    public Result<List<OrderComment>> findAllComments(){
       List<OrderComment> commentList = orderCommentService.findAllComments();
       return new Result(true,StatusCode.OK, "查询所有评价成功", commentList);
    }


}
